package com.baoxin.chenxixc4coach;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;

import com.baoxin.chenxixc4coach.adapter.CoachReadAdapter;
import com.baoxin.chenxixc4coach.bean.CoachRead;
import com.baoxin.chenxixc4coach.utils.Interfaces;
import com.baoxin.chenxixc4coach.utils.NetUtil;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;

/**
 * 教练须知
 */
public class CoachReadActivity extends BaseActivity {

    private RecyclerView recyclerView;
    private List<CoachRead> coachReadList;
    private CoachReadAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_coach_read);
        Toolbar toolbar = findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayShowTitleEnabled(false);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        recyclerView = findViewById(R.id.recyclerview);
        adapter = new CoachReadAdapter(this);
        coachReadList = new ArrayList<>();
        initData();
        adapter.setData(coachReadList);
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        recyclerView.setLayoutManager(layoutManager);
        recyclerView.setAdapter(adapter);
        recyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
    }

    private void initData() {
        CoachRead c = new CoachRead();
        c.setPicURL("");
        c.setTitle("驾校教练在示范教学中应该注意哪些事项？");
        c.setTitle2("驾校教练在示范教学中应该注意哪些事项？教练员本身应对训练科目的动作要有深刻的认识，能够对复杂动作进行合理的分解");

        coachReadList.add(c);



    }
}
